﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace FySystem.Net.FyHttp
{
    [Obsolete("C#的HttpClient蛮好的，不需要了这个类了")]
    public class FyHttpParams
    {
        public List<KVString> Parameters = new List<KVString>();

        public FyHttpParams() { }

        public FyHttpParams(string key,string value)
        {
            Parameters.Add(new KVString() { Key = key, Value = value });
        }

        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public FyHttpParams Add(string key,string value)
        {
            Parameters.Add(new KVString() { Key = key, Value = value });
            return this;
        }

        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="param"></param>
        /// <returns></returns>
        public FyHttpParams Add(KVString param)
        {
            Parameters.Add(param);
            return this;
        }

        /// <summary>
        /// 判断是否有参数
        /// </summary>
        /// <returns></returns>
        public bool HasParams()
        {
            if (Parameters == null)
                return false;
            else if (Parameters.Count == 0)
                return false;
            return true;
        }
    }
}
